home *** CD-ROM | disk | FTP | other *** search
/ GameStar Special 2004 September / GSSH0904CD1.iso / RiseofNations / RedFront / RedFront.exe / Red Front / Red Front - 12 - Berlin.bhs < prev    next >
Text File  |  2004-02-15  |  12KB  |  346 lines

  1. /* Red Front
  2.    Berlin
  3.    
  4.    These events will control the Berlin scenario for the Red Front campaign.
  5.   
  6.    Campaign By: Kevin 'DarthVeda' Chulski
  7.    Contact: darthveda@hotmail.com
  8.    Please email any questions/suggestions/comments that you have!   
  9. */
  10.  
  11. scenario
  12. {
  13.  
  14.   set_nation_name("Russians", $S("Red Army"));
  15.   set_nation_name("Romans", $S("Germans"));
  16.   
  17.   // initialize variables
  18.   
  19.   static int month = 4;
  20.   static int day = 26;
  21.   static int dayRate = 300;
  22.   static int rallyID = 0;
  23.   static int i = 0;
  24.   static int X = 0;
  25.   static int Y = 0;
  26.   static int playerID = 0; // ID of human player
  27.   
  28. labels {
  29.   //Add any constant labels here in a comma separated list.
  30.   
  31. }
  32.  
  33. run_once {
  34.   //Insert commands that should be executed only once when the script is loaded here.
  35.   
  36.   //disable weird things
  37.  
  38.   disable_type("Helicopter");
  39.   disable_type("Nuclear Missile");
  40.   disable_type("Missile Silo");
  41.   disable_type("Aircraft Carrier");
  42.   disable_type("Spy");
  43.   
  44.   if ( building_resource_bonus_disable() != 1 )
  45.   {
  46.     print_game_msg( "Error: couldn't disable building resources!" );
  47.   }
  48.   if ( buildings_gather_disable() != 1 )
  49.   {
  50.     print_game_msg( "Error: couldn't disable building gather!" );
  51.   }
  52.   if ( plunder_disable() != 1 )
  53.   {
  54.     print_game_msg( "Error: couldn't disable plunder!" );
  55.   }
  56.   
  57.   
  58.   // disable wonders
  59.   
  60.   disable_type( "Pyramids" );
  61.   disable_type( "Colossus" );
  62.   disable_type( "Terra Cotta Army" );
  63.   disable_type( "Colosseum" );
  64.   disable_type( "Temple of Tikal" );
  65.   disable_type( "Porcelain Tower" );
  66.   disable_type( "Angkor Wat" );
  67.   disable_type( "Versailles" );
  68.   disable_type( "Statue of Liberty" );
  69.   disable_type( "Kremlin" );
  70.   disable_type( "Taj Mahal" );
  71.   disable_type( "Eiffel Tower" );
  72.   disable_type( "Supercollider" );
  73.   disable_type( "Space Program" );
  74.   
  75.   // disable certain buildings and guys
  76.   
  77.   disable_type( "Small City" );
  78.   disable_type( "Citizen" );
  79.   disable_type( "Temple" );
  80.   disable_type( "Library" );
  81.   disable_type( "University" );
  82.   disable_type( "Airbase" );
  83.   disable_type( "Caravan" );
  84.   disable_type( "Merchant" );
  85.   disable_type( "Supply Wagon" );
  86.   disable_type( "Shipyard" );
  87.   disable_type( "General" );
  88.   
  89.   // disable ships
  90.   
  91.   disable_type("Submarine");
  92.   disable_type("Battleship");
  93.   disable_type("Cruiser");
  94.   
  95.   // Gain Upgrades 
  96.   
  97.   // disable upgrades 
  98.  
  99.   // set timers
  100.   
  101.   set_timer( "cdar", dayRate );
  102.   set_timer( "refill", 60 );
  103.   set_timer( "prod", 30 );
  104.   set_timer( "aicash", 60 );
  105.  
  106.   // disable triggers
  107.   
  108.   disable_trigger( "help_p1_build" );
  109.   
  110.   // blurb or cinematic
  111.   
  112.   // miscelaneous  
  113.   
  114.   for ( i = 1; i<4; i++ )
  115.   {
  116.     force_transport_ability( i );
  117.     gain_tech( i, "Artificial Intelligence" );
  118.   }
  119.  
  120.   set_victory_message( "Berlin was crushed!" );
  121.        
  122. }
  123.  
  124. //Main script body.
  125. //Add triggers and other commands to be executed each game frame here.
  126. //Use Edit->Insert Trigger Function to select from the list of available functions
  127. //Use Edit->Insert Trigger Block to add a blank trigger block.
  128. //See ./scenario/sample_script.bhs for additional documentation
  129.  
  130.   trigger opening_dialog ( )
  131.   {
  132.     add_objective_text( "Date: April 26, 1945", "date", "null.wav" );
  133.     popup_dialog( "April 1945 - Comrade general, it has been a long road to victory, and now it seems in sight.  There is only one option for you general: victory by conquest!  Capture the Reichstag, the seat of fascist power, and the Soviet Union will be victorious.");
  134.     popup_dialog( "NEW OBJECTIVE: Capture the Reichstag" );
  135.     add_objective( "Capture the Reichstag", "cap", "null.wav" );
  136.     popup_dialog( "While two Russian armies are racing towards victory, you can only control one.  But you must be first to the Reichstag." );
  137.     while ( !playerID )
  138.     {
  139.       if ( popup_choice( "OPTION A: Play the role of Zhukov in the North", "Yes", "No..." ) == 1 )
  140.       {
  141.         playerID = 1;
  142.       }
  143.       else if ( popup_choice( "OPTION B: Play the role of Koniev in the South", "Yes", "Go Back..." ) == 1 )
  144.       {
  145.         playerID = 2;
  146.         move_camera( 374, 380 );
  147.         set_leader_difficulty( 1, 100 );
  148.         enable_production_ai( 1 );
  149.         enable_combat_ai( 1 );
  150.         enable_all_unit_ai( 1 );
  151.         enable_trigger( "help_p1_build" );
  152.       }
  153.     }
  154.     change_objective_text( "cap", "Capture the Reichstag first" );
  155.     switch_player_control( playerID );
  156.     
  157.   }
  158.   
  159.   trigger tipster ( time_sec() == 45 )
  160.   {
  161.     popup_dialog( "TIP: The more parts of the city you hold, the more income you receive.  Troops are produced instantly, so take advantage of this." ); 
  162.   }
  163.    
  164.   trigger calendar ( timer_expired( "cdar" ) )
  165.   {  
  166.     // check for month change
  167.     if ( day == 30 && month == 4 )
  168.     {
  169.       day = 1;
  170.       month = 5;
  171.       popup_dialog( "Stalin has given you until the end of May 2 to capture the Reichstag, comrade general.  You had best not disapoint him." );
  172.       change_objective_text( "cap", "Capture the Reichstag by May 2" );
  173.     }
  174.     else if ( day == 2 && month == 5 )
  175.     {
  176.       // It's the end of the scenario
  177.       popup_dialog( "General, though the Russian army seemed unstoppable, you have somehow clenched defeat from the jaws of victory.  You have been dismissed while more capable generals have been tasked with taking Berlin." );
  178.       defeat( 1 );
  179.       defeat( 2 );
  180.     }
  181.     else
  182.     {
  183.       // no month change, normal increment
  184.       day++;
  185.     }
  186.     
  187.     if ( month == 4 )
  188.     {
  189.       change_objective_text( "date", "Date: April " +day+", 1945" );
  190.     }
  191.     else {
  192.       change_objective_text( "date", "Date: May " +day+", 1945" );
  193.     }
  194.        
  195.     set_timer( "cdar", dayRate );
  196.     enable_trigger( "calendar" );
  197.   } // end of calendar trigger
  198.   
  199.   trigger hitler_ist_kaput ( city_assimilate( 2, "Fⁿhrerbunker" ) )
  200.   {
  201.     popup_dialog( "Soldiers of the glorious Red Army have today captured Hitler's bunker.  They have discovered that the coward has comitted suicide rather than face the justice of the Soviet people.  Troops celebrate the occasion and the news of Hitler's death boosts morale. " );
  202.     give_good( 2, "food", num_cities( i ) * 50 );
  203.     give_good( 2, "timber", num_cities( i ) * 50 );
  204.     give_good( 2, "metal", num_cities( i ) * 50 );
  205.     give_good( 2, "oil", num_cities( i ) * 50 );
  206.     give_good( 2, "wealth", num_cities( i ) * 50 );
  207.   }
  208.   
  209.   trigger we_got_him ( city_assimilate( 1, "Fⁿhrerbunker" ) )
  210.   {
  211.     // A not so historical approach?
  212.   
  213.     popup_dialog( "Elite shock troops under Zhukov surprise Hitler in his bunker.  The dictator is caught amid preparations for suicide and is taken into custody.  By week's end, his bruised and battered body will be on display for a public trial in Red Square.  The Soviet people will make him sorry his suicide was not successful. " );    
  214.     if ( playerID == 1 )
  215.     {
  216.       popup_dialog( "Comrade general, Stalin has personally telephoned your headquarters to thank you on behalf of the Soviet people for capturing the criminal Hitler.  He has assured you that you will have the personal pleasure of \"interrogating\" the criminal once the battle for Berlin is completed. " );
  217.     }
  218.     give_good( 1, "food", num_cities( i ) * 50 );
  219.     give_good( 1, "timber", num_cities( i ) * 50 );
  220.     give_good( 1, "metal", num_cities( i ) * 50 );
  221.     give_good( 1, "oil", num_cities( i ) * 50 );
  222.     give_good( 1, "wealth", num_cities( i ) * 50 );
  223.   }
  224.   
  225.   trigger reichstag_ist_kaput1 ( city_assimilate( 1, "Reichstag" ) )
  226.   {
  227.     if ( playerID == 1 )
  228.     {
  229.       objective_complete( "cap" );
  230.       popup_dialog( "The bombed, bullet-wrecked, and smoking remains of the Reichstag are a testiment to the Third Reich, which now lay in smoldering ruin under the feet of the victorious Red Army." );
  231.       popup_dialog( "Comrade General, your victory here has been historic and your struggle has been epic.  You have seen the pain of defeat and the glory of victory and have lead the armies of Russia through both without hesitation." );
  232.       popup_dialog( "News of the fall of Berlin spreads quickly. First to Moscow and comrade Stalin, who sends his congratulations, and onto the allies who stand and marvel at your accomplishments.  The war is over now comrade general, and our triumph is owed so very much to your actions.  Congratulations!" );
  233.       popup_dialog( "Victory in Europe.  Victory on the Red Front." );
  234.       set_victory_message( "Victory!" );
  235.       victory( playerID );
  236.     }
  237.     else
  238.     {
  239.       popup_dialog( "It seems that Marshal Koniev has beaten you to the Reichstag, general.  The defeat is an utterly humiliating blow to you and the soldiers under you.  While the victory over the Third Reich is complete, it is obvious that there is something hollow about this victory for you. " );
  240.       defeat ( 1 );
  241.       defeat ( 2 );
  242.     }
  243.     
  244.   }
  245.   
  246.   trigger reichstag_ist_kaput2 ( city_assimilate( 2, "Reichstag" ) )
  247.   {
  248.     // A less historical option
  249.   
  250.     if ( playerID == 2 )
  251.     {
  252.       objective_complete( "cap" );
  253.       popup_dialog( "Troops under Marshal Koniev have today captured the seat of fascist power, the Reichstag.  Though the defense was fierce, the tide of the glorious Soviet Union would not be denied and the Russian soldier proved his mettle." );
  254.       popup_dialog( "Comrade General, your victory here has been historic and your struggle has been epic.  You have seen the pain of defeat and the glory of victory and have lead the armies of Russia through both without hesitation." );
  255.       popup_dialog( "News of the fall of Berlin spreads quickly, as does the fact that your leadership is perhaps the greatest in the world.  Already comrade Stalin has called your headquarters to praise your efforts.  The war is over now comrade general, and our triumph is owed so very much to your actions.  Congratulations!" );
  256.       popup_dialog( "Victory in Europe.  Victory on the Red Front." );
  257.       set_victory_message( "Victory!" );
  258.       victory( playerID );
  259.     }
  260.     else
  261.     {
  262.       popup_dialog( "It seems that Marshal Zhukov has beaten you to the Reichstag, general.  The defeat is an utterly humiliating blow to you and the soldiers under you.  While the victory over the Third Reich is complete, it is obvious that there is something hollow about this victory for you. " );
  263.       defeat ( 1 );
  264.       defeat ( 2 );
  265.     }
  266.     
  267.   }
  268.   
  269.   trigger fill_er_up ( timer_expired( "refill" ) )
  270.   {
  271.     for ( i = 1; i < 5; i++ )
  272.     {
  273.       give_good( i, "food", num_cities( i ) * 50 );
  274.       give_good( i, "timber", num_cities( i ) * 50 );
  275.       give_good( i, "metal", num_cities( i ) * 50 );
  276.       give_good( i, "oil", num_cities( i ) * 50 );
  277.       give_good( i, "wealth", num_cities( i ) * 50 );
  278.     }
  279.     
  280.     create_unit( 1, 28, 28, "JS-2 Tank", 1 );
  281.     create_unit( 2, 373, 382, "JS-2 Tank", 1 );
  282.   
  283.     set_timer( "refill", 60 );
  284.     enable_trigger( "fill_er_up" );
  285.   }
  286.   
  287.   trigger pep_talk ( timer_expired( "prod" ) )
  288.   {
  289.     // Give the AI a push... go to Reichstag!
  290.     rallyID = 0;
  291.     int opID = 0;
  292.     
  293.     if ( playerID == 1 )
  294.     {
  295.       opID = 2;
  296.     }
  297.     else
  298.     {
  299.       opID = 1;
  300.     }
  301.     
  302.     for( i = 0; i < population( opID ); i++ )
  303.     {
  304.       rallyID = find_military( opID );
  305.       if ( ( length( object_type( opID, rallyID ) ) != 6 ) && ( length( object_type( opID, rallyID ) ) != 7 ) )
  306.       {
  307.         unit_attack_to_order( opID, rallyID, 213, 197 );
  308.       }
  309.     }
  310.     
  311.     set_timer( "prod", 60 );
  312.     enable_trigger( "pep_talk" ); 
  313.   }
  314.   
  315.   trigger help_p1_build ( )
  316.   {
  317.     train_unit_with_cost( 1, 1, "Red Guards Infantry");
  318.     train_unit_with_cost( 1, 1, "Tank");
  319.     train_unit_with_cost( 1, 1, "Katyusha Rocket");
  320.     
  321.     enable_trigger( "help_p1_build" );
  322.   }
  323.   
  324.   trigger cashier ( timer_expired( "aicash" ) )
  325.   {
  326.     int opID2 = 0;
  327.     if ( playerID == 1 )
  328.     {
  329.       opID2 = 2;
  330.     }
  331.     else
  332.     {
  333.       opID2 = 1;
  334.     }
  335.     
  336.     give_good( opID2, "food", 1000 );
  337.     give_good( opID2, "timber", 1000 );
  338.     give_good( opID2, "metal", 1000 );
  339.     give_good( opID2, "oil", 1000 );
  340.     give_good( opID2, "wealth", 1000 );    
  341.     
  342.     set_timer( "aicash", 60 );
  343.     enable_trigger( "cashier" );
  344.   }
  345.   
  346. }